package entity;

public class Telephone {

  private String masterNumber;
  private String countryCode;

  private String telephoneNumber;

  public Telephone(String masterNumber, String countryCode, String telephoneNumber) {
    this.masterNumber = masterNumber;
    this.countryCode = countryCode;
    this.telephoneNumber = telephoneNumber;
  }

  public void setMasterNumber(String masterNumber) {
    this.masterNumber = masterNumber;
  }

  public String getMasterNumber(){
    return masterNumber;
  }

  public String returnTelephone(){
    return countryCode+telephoneNumber;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Telephone other = (Telephone) obj;
    if (masterNumber == null) {
      if (other.masterNumber != null)
        return false;
    } else if (!masterNumber.equals(other.masterNumber))
      return false;
    if (countryCode == null) {
      if (other.countryCode != null)
        return false;
    } else if (!countryCode.equals(other.countryCode))
      return false;
    if (telephoneNumber == null) {
      if (other.telephoneNumber != null)
        return false;
    } else if (!telephoneNumber.equals(other.telephoneNumber))
      return false;
    return true;
  }
}

